package com.roamer.audition.common.request;

import com.roamer.audition.common.enums.ResultEnum;
import com.roamer.audition.common.enums.ScoreEnum;
import com.roamer.audition.common.enums.StatusEnum;
import com.roamer.validator.DateTime;
import com.roamer.validator.DimensionType;
import com.roamer.validator.EnumValue;
import com.roamer.validator.MatchType;
import com.roamer.validator.gruop.Add;
import com.roamer.validator.gruop.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 面试计划 DTO
 *
 * @author roamer
 * @version V1.0
 * @date 2019-08-20 22:55
 */
@ApiModel(value = "面试计划DTO")
@Data
public class AuditionRecordDTO implements Serializable {
    private static final long serialVersionUID = 5155454500769984854L;

    /**
     * 主键ID
     */
    @NotNull(message = "开始日期不可为NULL", groups = {Update.class})
    private Long id;

    /**
     * 开始日期
     */
    @ApiModelProperty(value = "开始日期", required = true)
    @NotNull(message = "开始日期不可为NULL", groups = {Add.class, Update.class})
    @DateTime(matchType = MatchType.ge, dimension = DimensionType.day, message = "开始日期必须大于等于当前日期")
    private Long beginTime;

    /**
     * 结束日期
     */
    @ApiModelProperty(value = "结束日期", required = true)
    @DateTime(matchType = MatchType.ge, dimension = DimensionType.day, message = "开始日期必须大于等于当前日期")
    private Long endTime;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Size(max = 255, message = "备注最大字符长度255", groups = {Add.class, Update.class})
    private String remark;

    /**
     * 面试评分
     */
    @ApiModelProperty(value = "面试评分", allowableValues = "range[1, 5]")
    @EnumValue(enumClass = ScoreEnum.class, enumMethod = "exist")
    private Byte score;

    /**
     * 进行状态
     */
    @ApiModelProperty(value = "进行状态", required = true, allowableValues = "range[0, 2]")
    @NotNull(message = "结束日期不可为NULL", groups = {Update.class})
    @EnumValue(enumClass = StatusEnum.class, enumMethod = "exist")
    private Byte status;

    /**
     * 面试结果
     */
    @ApiModelProperty(value = "面试结果", allowableValues = "range[0, 2]")
    @EnumValue(enumClass = ResultEnum.class, enumMethod = "exist")
    private Byte result;

    /**
     * 删除标记
     */
    @ApiModelProperty(value = "删除标记", required = true, allowableValues = "true, false")
    @NotNull(message = "删除标记不可为NULL", groups = {Add.class, Update.class})
    private Boolean deleted;

}
